function onComplete(text, xml)
{
  arr = text.split(":");
  var tfImie = document.getElementById("tfImie");
  var tfNazwisko = document.getElementById("tfNazwisko");

  if(arr[0] == "error"){
    if(arr.length == 2){
      if(arr[1] == "imie"){
        tekst = "Nieprawidowe dane w polu 'Imi'.";
        tfImie.style.backgroundColor = "#FFFF00";
        tfNazwisko.style.backgroundColor = "#FFFFFF";
      }
      else if(arr[1] == "nazwisko"){
        tekst = "Nieprawidowe dane w polu 'Nazwisko'.";
        tfImie.style.backgroundColor = "#FFFFFF";
        tfNazwisko.style.backgroundColor = "#FFFF00";
      }
      else{
        tekst = "Nieprawidowa odpowied serwera.";
      }
    }
    else if(arr.length == 3){
      if(arr[1] == "imie" && arr[2] == "nazwisko"){
        tekst = "Nieprawidowe dane w polach 'Imi' i 'Nazwisko'.";
        tfImie.style.backgroundColor = "#FFFF00";
        tfNazwisko.style.backgroundColor = "#FFFF00";
      }
    }
    else{
      tekst = "Nieprawidowa odpowied serwera.";
    }
    disableButton = false;
    alert(tekst);
  }
  else{
    tfImie.style.backgroundColor = "#FFFFFF";
    tfNazwisko.style.backgroundColor = "#FFFFFF";
    alert(text);
    disableButton = true;
  }
}

